-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(endo): Module specifier and URL math #342
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kriskowal
force-pushed
the
kris/endo-math
branch
2 times, most recently
from
June 18, 2020 19:06
10925df
to
650af99
Compare
kriskowal
force-pushed
the
kris/endo-math
branch
3 times, most recently
from
June 19, 2020 00:33
c148ba9
to
16d2824
Compare
kriskowal
force-pushed
the
kris/endo-math
branch
4 times, most recently
from
June 19, 2020 20:21
b2c8412
to
cdd3511
Compare
warner
approved these changes
Jun 23, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those issues are minor, feel free to land
kriskowal
force-pushed
the
kris/endo-math
branch
2 times, most recently
from
June 24, 2020 02:57
00323de
to
c0a1c68
Compare
The Node.js package.json allows relative or absolute module specifiers like `"main": "./index.js"` or `"main": "index.js"`. The `relativize` function normalizes all such paths to their relative form since Endo compartments use absolute specifiers for external linkage and relative specifiers for internal linkage. It is not possible for `package.json` to express a module specifier that refers to a module in another package. The join function joins an absolute module specifier to a relative module specifier. Creating a compartment map joins external dependency package names to internal module specifiers. The external dependency specifier must be absolute and the internal module specifier must be relative. Endo uses this resolve function for all compartment resolve hooks. The referrer is always a relative module specifier like "./index.js". The referent may be relative to import a module in the same package, or absolute to import an external dependency, either a built-in module or a module from a third-party package.
kriskowal
force-pushed
the
kris/endo-math
branch
from
June 24, 2020 03:00
c0a1c68
to
a7f8be3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
url.js
module implementsrelative(referrer, specifier)
to reconstruct a relative path between two URLs. This is useful for creating references in acompartmap.json
that are normalized relative to the root of an archive.The remaining
module-specifier.js
provides three functions for manipulating Node.js packaged module specifiers.The Node.js package.json allows relative or absolute module specifiers
like
"main": "./index.js"
or"main": "index.js"
.The
relativize
function normalizes all such paths to their relativeform since Endo compartments use absolute specifiers for external
linkage and relative specifiers for internal linkage.
It is not possible for
package.json
to express a module specifierthat refers to a module in another package.
The join function joins an absolute module specifier to a relative
module specifier.
Creating a compartment map joins external dependency package names to
internal module specifiers.
The external dependency specifier must be absolute and the internal
module specifier must be relative.
Endo uses this resolve function for all compartment resolve hooks.
The referrer is always a relative module specifier like "./index.js".
The referent may be relative to import a module in the same package, or
absolute to import an external dependency, either a built-in module or a
module from a third-party package.